<template>
  <div class="myList">
    <mt-header fixed>
      <router-link to="/my_person" slot="left">
        <mt-button icon="back">返回</mt-button>
      </router-link>
    </mt-header>
    <div v-for="item in list" :key="item._id">
      <mt-cell is-link class="haha">
        <p>{{item.listName}}</p>
        <span style="color: green">{{item.allGoodsCount}}件商品共计{{item.allGoodsPrice}}元</span>
      </mt-cell>

    </div>
  </div>
</template>


<script>
import { getMyList } from '../services/product_type';
import cookie from 'js-cookie';

export default {
  name: 'myList',
  data() {
    return {
      list: [],
    }
  },
  created() {
    getMyList({
      userName: cookie.get('userName'),
    })
      .then( res => {
        console.log(res);
        this.list = res.data.info;
      })
      .catch( err => {
        console.log(err);
      })
  }
}
</script>
<style scoped>
.haha{
  position: relative;
  top: 32px;
}
</style>

